﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using System.Net;
using System.IO;
using HtmlAgilityPack;

namespace WebScraping
{
    class CScraping
    {
        public string GetWebContent(string strLink)
        {
            string strContent = "";
            try
            {
                //tham khao them o day
                //http://stackoverflow.com/questions/13588932/webclient-downloadstring-seems-to-change-some-of-the-html-from-an-external-site
                //WebRequest objWebRequest = WebRequest.Create(strLink);
                //objWebRequest.Credentials = CredentialCache.DefaultCredentials;
                //WebResponse objWebResponse = objWebRequest.GetResponse();
                //Stream receiveStream = objWebResponse.GetResponseStream();
                //StreamReader readStream = new StreamReader(receiveStream, System.Text.Encoding.UTF8);
                //strContent = readStream.ReadToEnd();
                //objWebResponse.Close();
                //readStream.Close();

            }
            catch (Exception ex)
            {                
            }
            return strContent;
            
        }        
    }
}
